home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 May: Tool Chest / Dev.CD May 97 TC.toast / Sample Code / Networking / Http Server / •OT_Classes / TAddr.h < prev    next >
Encoding:
Text File  |  1996-01-11  |  1.4 KB  |  56 lines  |  [TEXT/CWIE]

  1. //    TAddr.h - Macintosh OpenTransport network "address family independent" class object
  2. // 
  3. // Apple Macintosh Developer Technical Support
  4. // Written by:  Vinne Moscaritolo
  5. //
  6. //  Copyright (work in progress)  Apple Computer, Inc All rights reserved.
  7. //
  8. // You may incorporate this sample code into your applications without
  9. // restriction, though the sample code has been provided "AS IS" and the
  10. // responsibility for its operation is 100% yours.  However, what you are
  11. // not permitted to do is to redistribute the source as "DSC Sample Code"
  12. // after having made changes. If you're going to re-distribute the source,
  13. // we require that you make it clear in the source that the code was
  14. // descended from Apple Sample Code, but that you've made changes.
  15. // 
  16.  
  17. #ifndef _H_TAddr
  18. #define _H_TAddr
  19.  
  20. #include <OpenTransport.h>
  21. #include <iostream.h>
  22.  
  23. //
  24. // TAddr.h - "address family independent" class object
  25. //
  26. class TAddr 
  27. {
  28.  
  29. public:
  30. //     CONSTRUCTORS AND DESTRUCTORS
  31.  
  32. // HIGH LEVEL FUNCTIONS
  33. public:
  34. // ACCESSORS 
  35.   virtual size_t             GetSize (void) const = 0;
  36.   virtual size_t             GetMaxSize (void) const = 0;
  37.   virtual OTAddressType     GetType (void) const  = 0;
  38.   virtual OTAddress*        GetAddr (void) const = 0;
  39.  
  40. // Conversion
  41.   virtual void              ToNetbuf(TNetbuf* n);
  42.   virtual TAddr*            Clone() = 0;
  43.       
  44. // CLASS FUNCTIONS
  45.     static     TAddr*             Factory(OTAddressType);
  46.     static     TAddr*             Factory(TNetbuf* n);
  47.  
  48. // PRIVATE FIELDS
  49. protected:
  50.     TAddr(){};
  51. };
  52.  
  53.  
  54. #endif
  55.  
  56.